<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>角色列表</title>
    <#include "/layout/css.html"/>
</head>
<body class="body">
<!-- 工具集 -->
<span class="fl">
	<button class="layui-btn mgl-20" id="btn-add">添加系统</button>
</span>
<hr>
<!-- 表格 -->
<div class="layui-tab layui-tab-card">
  <ul class="layui-tab-title">
  	<#list systemList as x>
  		<li <#if x_index == 0>class="layui-this"</#if> >${x.name!}</li>
  	</#list>
  </ul>
  <div class="layui-tab-content" >
		<#list systemList as x>
	  		<div class="layui-tab-item <#if x_index == 0>layui-show</#if>">
	    		<iframe src="${basePath}/menu/list?systemId=${x.sysMenuId}" frameborder="0" width="100%" height="580px"></iframe>
			</div>
  		</#list>
  </div>
</div>

<#include "/layout/js.html"/>
<script type="text/javascript">
    // layui方法
    layui.use(['table', 'form', 'layer', 'vip_table'], function () {
        // 操作对象
        var form = layui.form
                , table = layui.table
                , layer = layui.layer
                , vipTable = layui.vip_table
                , $ = layui.jquery;
        var table = layui.table;
        function addOrEditData(dataId){
        	dataId = isNullGetDef(dataId,'');
        	var title = "添加系统";
        	if(isNotNull(dataId)){
        		title = "编辑系统";
        	}
        	layui.use('layer', function(){
        		layer.open({
        			  type: 2,
        			  title: title,
        			  shadeClose: false,
        			  shade: 0.8,
        			  area: ['90%', '90%'],
        			  content: '${basePath}/menu/addOrEdit?dataId='+dataId //iframe的url
        			  ,end:function(){
        				  searchFun();
        			  }		
        		}); 
        	});  
        }
        $('#btn-add').on('click', function () {
        	addOrEditData();
        });
        
    });
</script>
</body>
</html>